#pragma warning(disable : 4996)
#include<stdio.h>
int removeElement(int* nums, int numsSize, int val) 
{
    int end = numsSize - 1;
    int start = 0;
    int count = 0;
    for (start = 0; start < numsSize; start++)
    {
        if (nums[start] == val)
        {
            for (; end >= 0; end--)
            {
                if (end > start)
                {
                    if (nums[end] != val)
                    {
                        nums[start] = nums[end];
                        end--;
                        break;

                    }
                }
                
            }

            count++;
        }
    }
    return numsSize - count;


}
int removeDuplicates(int* nums, int numsSize) {
    int des = 0;
    int src = 1;
    while (src < numsSize)
    {
        if (nums[des] != nums[src])
        {
            nums[++des] = nums[src++];
        }
        else
        {
            src++;
        }

    }
    return des + 1;

}

void merge(int* nums1, int nums1Size, int m, int* nums2, int nums2Size, int n) {
    int des = m - 1;
    int sou = n - 1;
    int i = m + n - 1;
    while (des >= 0 && sou >= 0)
    {
        if (nums2[sou] > nums1[des])
        {
            nums1[i--] = nums2[sou--];

        }
        else
        {
            nums1[i--] = nums1[des--];
        }
    }
    while (sou >= 0)
    {
        nums1[i--] = nums2[sou--];

    }

}
int main()
{
    //int arr[] = { 1,1 };
    /*int k=removeElement(arr, sizeof(arr)/sizeof(arr[0]), 2);
    for (int i = 0; i < k; i++)
    {
        printf("%d ", arr[i]);
    }

    printf("%d", k);*/
    //int k=removeDuplicates(arr, sizeof(arr) / sizeof(arr[0]));
   /* int nums1[] = {0}, nums2[] = { 1 };
    merge(nums1, 1, 0, nums2, 1, 1);*/
    /*for (int i = 0; i < k; i++)
    {
        printf("%d ", arr[i]);
    }*/
    int arr[] = { 1,2,3, };
    int* b = arr;
    b[0] = 2;
    int* c = b;
    c[1] = 3;



	return 0;
}